import 'package:flutter/material.dart';
import 'package:get/get.dart';

class DialogUtil {
  static Future<void> defaultDialog(String title, String content,
      {confirmCallback, cancelCallback}) {
    return Get.defaultDialog(
        title: title.tr,
        titlePadding: title.isEmpty ? EdgeInsets.zero : null,
        middleText: content.tr,
        titleStyle: const TextStyle(
          fontSize: 16.0,
          fontWeight: FontWeight.w600
        ),
        confirm: TextButton(
            onPressed: () {
              Get.back();
              if (confirmCallback != null) {
                confirmCallback();
              }
            },
            child: Text(
              'confirm'.tr,
              style: const TextStyle(color: Colors.blue),
            )),
        cancel: TextButton(
            onPressed: () {
              Get.back();
              if (cancelCallback != null) {
                cancelCallback();
              }
            },
            child: Text(
              'cancel'.tr,
              style: const TextStyle(color: Colors.grey),
            )));
  }






}
